package net.mikoo.seals.manage.web.controller;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller

public class TestController {
	
	@Autowired
	private RedisTemplate<String,String> redisTemplate;
	
	@RequestMapping("/test")
	@ResponseBody
	public String testForm(String str,Model model) {
		
		redisTemplate.opsForValue().set("aaa", StringUtils.isNotBlank(str)?str:"无");
		
		return redisTemplate.opsForValue().get("aaa");
	}

}
